<!DOCTYPE html>
<html>

<head>
    <title>服务器统计</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/main.css">
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/4.1.1/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="dist/bootstrap-table.min.css">
    <script src="/dist/bootstrap-table.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.2/locale/bootstrap-table-zh-CN.min.js"></script>
</head>

<body>
    <div class="navTop">
        <a href="#" class="logoimg"><img src="/img/logo.png" alt=""></a>
        <div class="nav_right">
            <a href="/home" class="nav_icon indexicon"></a>
            <a href="/member.html" class="nav_icon userlisticon"></a>
            <a href="/host.html" class="nav_icon servericon"></a>
            <a href="javascript:void(0);" class="nav_icon logouticon"></a>
        </div>
    </div>
    <div class="mainContent">
        <div class="mainContent_box">
            <h3 class="listTitle">服务器信息列表</h3>
            <div class="listBox">
                <table id="table" data-hight="800" data-toggle="table" data-striped="false" data-classes="table table-hover">
                </table>
            </div>
        </div>
    </div>
</body>

</html>
<script type="text/javascript">
$('#table').bootstrapTable({
    url: "/home/host-list",
    align: "center",
    search: true,
    columns: [{
        field: 'deviceuuid',
        title: '设备编号',
        formatter: detailslink,
        align: 'center'

    }, {
        field: 'memberuuid',
        title: '用户uuid',
        align: 'center'
    }, {
        field: 'nickname',
        title: '服务器所属人',
        align: 'center'
    }, {
        field: 'create_time',
        title: '初次备份时间',
        align: 'center'
    }]
});

function detailslink(value, row, index) {
    return '<a href="details.html?server_id=' + row.id + '">' + value + '</a>';
}
</script>